package itcast.bos.base.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import itcast.bos.base.dao.AreaRespostory;
import itcast.bos.base.service.IAreaService;
import itcast.bos.domain.base.Area;

@Service
@Transactional
public class AreaService implements IAreaService {
	
	@Autowired
	private AreaRespostory ar;
	
	@Override
	public void save(List<Area> list) {
		ar.save(list);
		
	}

	@Override
	public Page<Area> findArea(Specification<Area> sf, Pageable pageable) {
		
		return ar.findAll(sf,pageable);
	}

	@Override
	public Area findByProvinceAndCityAndDistrict(String province, String city, String district) {
		// TODO Auto-generated method stub
		return ar.findByProvinceAndCityAndDistrict(province, city,  district);
	}

}
